package edu.mju.interceptor;

import edu.mju.proxy.Man;
import edu.mju.proxy.Person;

public class TestJdkProxyInterceptor {

	public static void main(String[] args) {
		System.out.println("-----------------以下是有拦截器------------------");
		//创建代理类对象
		JdkDynamicInterceptorProxy jdkDynamicInterceptorProxy = new JdkDynamicInterceptorProxy();
		//反射生成代理对象
		Person proxyMan = (Person) jdkDynamicInterceptorProxy.proxyRelation(new Man(),"edu.mju.interceptor.MyInterceptor");
		proxyMan.run();

		System.out.println("-----------------以下是无拦截器------------------");
		//创建代理类对象
		JdkDynamicInterceptorProxy jdkDynamicInterceptorProxy2 = new JdkDynamicInterceptorProxy();
		//反射生成代理对象
		Person proxyMan2 = (Person) jdkDynamicInterceptorProxy2.proxyRelation(new Man(),"");
		proxyMan2.run();
	}

}
